package com.jvyou.mybatis.datasource;

import javax.sql.DataSource;
import java.util.Properties;

/**
 * @author 橘柚
 * @version 1.0-SNAPSHOT
 * @Date 2024/7/20 15:00
 * @Description 数据库连接池工厂
 */
public class PooledJvyouDataSourceFactory implements JvyouDataSourceFactory {


    @Override
    public DataSource getDataSource(Properties properties) {
        String driver = properties.getProperty("driver");
        String url = properties.getProperty("url");
        String username = properties.getProperty("username");
        String password = properties.getProperty("password");
        return new PooledDataSource(username, password, driver, url);
    }

}
